﻿using System.Collections;
using GetTogether.RichText.Sys;
using GetTogether.RichText.Sys.Collection;

namespace GetTogether.RichText.Model
{

	
	public abstract class ReadOnlyBaseCollection : ReadOnlyCollectionBase
	{

		
		public sealed override bool Equals( object obj )
		{
			if ( obj == this )
			{
				return true;
			}
			
			if ( obj == null || GetType() != obj.GetType() )
			{
				return false;
			}

			return IsEqual( obj );
		} // Equals

		
		public override string ToString()
		{
			return CollectionTool.ToString( this );
		} // ToString

		
		protected virtual bool IsEqual( object obj )
		{
			return CollectionTool.AreEqual( this, obj );
		} // IsEqual

		
		public sealed override int GetHashCode()
		{
			return HashTool.AddHashCode( GetType().GetHashCode(), ComputeHashCode() );
		} // GetHashCode

		
		protected virtual int ComputeHashCode()
		{
			return HashTool.ComputeHashCode( this );
		} // ComputeHashCode

	} // class ReadOnlyBaseCollection

} 

